package com.iss.okair.db.mapper.transsql;

import com.iss.okair.db.entity.AssetsTranUse;
import org.apache.ibatis.jdbc.SQL;

public class FinalTransSQL {
    public String select(AssetsTranUse model){
        return new SQL(){
            {
                SELECT("*");
                FROM(" checkinlist c JOIN assets_finance f on c.assetsCode= f.assetsCode");
                if (model.getAssetsnamecn()!=null && !model.getAssetsnamecn().isEmpty()) {
                WHERE("namecn like '%"+model.getAssetsnamecn()+"%'");
                }
                if (model.getBatchno()!=null && !model.getBatchno().isEmpty()) {
                    WHERE("batchno like '%"+model.getBatchno()+"%'");
                }
            }
        }.toString();
    }
}
